import QtQuick 2.6
import QtQuick.Layouts 1.3
import Qt.labs.controls 1.0
import "../template" as Template
import "../js/MemberRecoverNavigator.qml.js" as Mn

Template.Navigator {
    title: "找回密码"
    id: nav

    Pane {
        width: parent.width
        height: parent.height


        StackLayout {
            id: stacklayout
            anchors.centerIn: parent
            GridLayout {
                anchors.centerIn: parent

                rowSpacing: 12

                columns: 2

                Label {
                    text: "邮箱"
                    Layout.alignment: Qt.AlignRight
                    font.pixelSize: 15
                }

                TextField {
                    id: mailText
                    Layout.alignment: Qt.AlignLeft
                    maximumLength: 32
                }


                Button {
                    Layout.columnSpan: 2
                    Layout.alignment: Qt.AlignHCenter
                    Layout.preferredWidth: implicitWidth * 1.5
                    text: "提交"
                    onClicked: Mn.request()
                }

            }


            GridLayout {
                anchors.centerIn: parent

                rowSpacing: 12

                columns: 2

                Label {
                    text: "验证码"
                    Layout.alignment: Qt.AlignRight
                    font.pixelSize: 15
                }

                TextField {
                    id: codeText
                    Layout.alignment: Qt.AlignLeft
                    maximumLength: 32
                }


                Button {
                    Layout.columnSpan: 2
                    Layout.alignment: Qt.AlignHCenter
                    Layout.preferredWidth: implicitWidth * 1.5
                    text: "提交"
                    onClicked: Mn.codeRequest()
                }

            }


            GridLayout {
                anchors.centerIn: parent

                rowSpacing: 12

                columns: 2

                Label {
                    text: "密码"
                    Layout.alignment: Qt.AlignRight
                    font.pixelSize: 15
                }

                TextField {
                    id: passText
                    Layout.alignment: Qt.AlignLeft
                    maximumLength: 32
                    echoMode: TextInput.PasswordEchoOnEdit
                }
                Label {
                    text: "再输一次"
                    Layout.alignment: Qt.AlignRight
                    font.pixelSize: 15
                }

                TextField {
                    id: pass2Text
                    Layout.alignment: Qt.AlignLeft
                    maximumLength: 32
                    echoMode: TextInput.PasswordEchoOnEdit
                }



                Button {
                    Layout.columnSpan: 2
                    Layout.alignment: Qt.AlignHCenter
                    Layout.preferredWidth: implicitWidth * 1.5
                    text: "提交"
                    onClicked: Mn.changePass()
                }

            }

        }

    }
}
